<template>
  <div class="main">
    <div class="header">
      <el-scrollbar style="height: 100%" :native="true">
        <el-row>
          <el-col @click.native="selectItem(item)" v-for="item in itemLists" :key="item.goodId" :span="6">
            <el-image style="width: 135px;height: 135px"
                      :src="item.showImage"
            ></el-image>
            <p>{{ item.goodName }}</p>
            <p>¥{{ JSON.parse(item.ysGoodsSku).data[0].price }}</p>
          </el-col>
        </el-row>
      </el-scrollbar>
    </div>
    <div class="bottom">
    </div>
  </div>
</template>

<script>
export default {
  name: 'ItemDetail',
  props: {
    value: Array
  }
  ,
  data() {
    return {
      itemLists: this.value
    }
  },
  methods: {
    selectItem(item) {

    }
  },
  watch: {
    value(newValue) {
      this.itemLists = newValue
    }
  }
}
</script>

<style lang="scss" scoped>
.main {
  height: 600px;
  display: flex;
  flex-direction: column;
  font-size: 17px;
  color: black;

  .header {
    height: 100%;

    .el-row {
      margin: 0;
      margin: 0;
    }

    .el-col {
      text-align: center;
      padding: 10px 0px 0px 0px;

      p {
        margin: 0;
        padding: 0;
      }
    }
  }

  .bottom {
    height: 17px;
    margin-top: -17px;
    background-color: white;
    z-index: 1;
  }
}
</style>
